﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.6
// Code is generated on: 2011年7月5日 11:37:44
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Data;
using CARMSData;
using CARMSData.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace CARMSData.FactoryClasses
{
	/// <summary>
	/// Generates IEntityFields instances for different kind of Entities. 
	/// This class is generated. Do not modify.
	/// </summary>
	public partial class EntityFieldsFactory
	{
		/// <summary>
		/// Private CTor, no instantiation possible.
		/// </summary>
		private EntityFieldsFactory()
		{
		}


		/// <summary>General factory entrance method which will return an EntityFields object with the format generated by the factory specified</summary>
		/// <param name="relatedEntityType">The type of entity the fields are for</param>
		/// <returns>The IEntityFields instance requested</returns>
		public static IEntityFields CreateEntityFieldsObject(CARMSData.EntityType relatedEntityType)
		{
			IEntityFields fieldsToReturn=null;
			IInheritanceInfoProvider inheritanceProvider = InheritanceInfoProviderSingleton.GetInstance();
			IFieldInfoProvider fieldProvider = FieldInfoProviderSingleton.GetInstance();
			IPersistenceInfoProvider persistenceProvider = PersistenceInfoProviderSingleton.GetInstance();
			switch(relatedEntityType)
			{
				case CARMSData.EntityType.ActionEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ActionEntity");
					break;
				case CARMSData.EntityType.ActionGridColumnEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ActionGridColumnEntity");
					break;
				case CARMSData.EntityType.ColumnToActionEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ColumnToActionEntity");
					break;
				case CARMSData.EntityType.CompanyEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "CompanyEntity");
					break;
				case CARMSData.EntityType.ConfigurationEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ConfigurationEntity");
					break;
				case CARMSData.EntityType.CountryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "CountryEntity");
					break;
				case CARMSData.EntityType.CustomerEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "CustomerEntity");
					break;
				case CARMSData.EntityType.DepartmentEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "DepartmentEntity");
					break;
				case CARMSData.EntityType.DictionaryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "DictionaryEntity");
					break;
				case CARMSData.EntityType.DictionaryCategoryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "DictionaryCategoryEntity");
					break;
				case CARMSData.EntityType.G100Entity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "G100Entity");
					break;
				case CARMSData.EntityType.G102Entity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "G102Entity");
					break;
				case CARMSData.EntityType.G103Entity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "G103Entity");
					break;
				case CARMSData.EntityType.G131Entity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "G131Entity");
					break;
				case CARMSData.EntityType.G132Entity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "G132Entity");
					break;
				case CARMSData.EntityType.GlossaryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "GlossaryEntity");
					break;
				case CARMSData.EntityType.LogEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "LogEntity");
					break;
				case CARMSData.EntityType.MailEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "MailEntity");
					break;
				case CARMSData.EntityType.MailTaskEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "MailTaskEntity");
					break;
				case CARMSData.EntityType.MessageEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "MessageEntity");
					break;
				case CARMSData.EntityType.ReportCategoryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ReportCategoryEntity");
					break;
				case CARMSData.EntityType.ReportCategoryToTemplateEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ReportCategoryToTemplateEntity");
					break;
				case CARMSData.EntityType.ReportFlowEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ReportFlowEntity");
					break;
				case CARMSData.EntityType.ReportHeaderEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ReportHeaderEntity");
					break;
				case CARMSData.EntityType.ReportOneEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ReportOneEntity");
					break;
				case CARMSData.EntityType.ReportPropertyEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ReportPropertyEntity");
					break;
				case CARMSData.EntityType.ReportStatusToButtonEventEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ReportStatusToButtonEventEntity");
					break;
				case CARMSData.EntityType.ReportTwoEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ReportTwoEntity");
					break;
				case CARMSData.EntityType.ReportValueEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ReportValueEntity");
					break;
				case CARMSData.EntityType.RoleEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "RoleEntity");
					break;
				case CARMSData.EntityType.RoleActionEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "RoleActionEntity");
					break;
				case CARMSData.EntityType.SalaryLevelEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "SalaryLevelEntity");
					break;
				case CARMSData.EntityType.TemplateEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "TemplateEntity");
					break;
				case CARMSData.EntityType.TemplateToReportCategoryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "TemplateToReportCategoryEntity");
					break;
				case CARMSData.EntityType.UserEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "UserEntity");
					break;
				case CARMSData.EntityType.UserActionEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "UserActionEntity");
					break;
				case CARMSData.EntityType.UserPermissionEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "UserPermissionEntity");
					break;
				case CARMSData.EntityType.UserRoleEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "UserRoleEntity");
					break;
			}
			return fieldsToReturn;
		}
		
		/// <summary>General method which will return an array of IEntityFieldCore objects, used by the InheritanceInfoProvider. Only the fields defined in the entity are returned, no inherited fields.</summary>
		/// <param name="entityName">the name of the entity to get the fields for. Example: "CustomerEntity"</param>
		/// <returns>array of IEntityFieldCore fields, defined in the entity with the name specified</returns>
		internal static IEntityFieldCore[] CreateFields(string entityName)
		{
			IFieldInfoProvider fieldProvider = FieldInfoProviderSingleton.GetInstance();
			IPersistenceInfoProvider persistenceProvider = PersistenceInfoProviderSingleton.GetInstance();
			return fieldProvider.GetEntityFieldsArray(entityName, persistenceProvider);
		}



		#region Included Code

		#endregion
	}
}
